Skip to content

feat: Add overrideAffected to the flag metadata - #44

Closed
kinyoklion wants to merge 1 commit into
mainfrom
devin/1794241273-ruby-override-affected
Closed

kinyoklion wants to merge 1 commit into
mainfrom
devin/1794241273-ruby-override-affected

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Requirements

  • I have added test coverage for new or changed functionality
  • I have followed the repository's pull request submission guidelines
  • I have validated my changes against all supported platform versions

Related issues

OpenFeature provider behavior spec (OFP) 1.1.0 added overrideAffected to the flag metadata table (Requirement 3.3.2), applying when the wrapped SDK supports flag overrides (OVERRIDE 1.6.1). Found during the weekly OpenFeature provider audit.

Describe the solution you've provided

Evaluations whose LaunchDarkly reason is marked override-affected now carry overrideAffected: true in the flag metadata. The key is omitted otherwise, the same way inExperiment is handled.

metadata['overrideAffected'] = true if reason.respond_to?(:override_affected) && reason.override_affected

No released LaunchDarkly Ruby SDK has flag overrides yet. EvaluationReason#override_affected exists on the SDK's feat/overrides branch (ruby-server-sdk #450, marked experimental). The respond_to? guard means the provider keeps working with 8.19.x, where the key is never present, and picks up the indicator once an SDK with overrides is installed. The launchdarkly-server-sdk requirement is unchanged. The README flag metadata table lists the new key and says it needs an SDK version that has overrides.

Describe alternatives you've considered

Waiting for the Ruby SDK release with overrides, then requiring that version. That would tie this provider release to the SDK release, and the guard costs one method check.

Additional context

Testing: bundle exec rspec (77 examples) and bundle exec rubocop on Ruby 3.4 against 8.19.1. Specs stub override_affected on a reason to cover true, false and absent. I also ran the converter against the feat/overrides SDK branch: EvaluationReason.fallthrough.with_override_affected(true) produced {"variationIndex" => 0, "overrideAffected" => true}.

Link to Devin session: https://app.devin.ai/sessions/afef6eb710c1429f878ab14b829c297a
Open in Devin Desktop: https://app.devin.ai/desktop/session/afef6eb710c1429f878ab14b829c297a?variant=devin


Devin Review

Co-Authored-By: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

kinyoklion added a commit that referenced this pull request Nov 16, 2026
**Requirements**

- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform
versions

**Related issues**

- OFP 1.1.0 spec change:
launchdarkly/sdk-specs#284
- Supersedes the closed
#44 (same
branch)

**Describe the solution you've provided**

`ResolutionDetailsConverter` now sets `overrideAffected: true` in flag
metadata when `EvaluationReason#override_affected` is true, and omits it
otherwise (same as `inExperiment`, and as js-core's
`translateResult.ts`). The `launchdarkly-server-sdk` dependency moves
from `~> 8.19` to `~> 8.20`, the first release with `override_affected`.
The README flag-metadata table and feature matrix list the new key.

Tests cover override-affected true, false, unmarked reasons and an
override-affected error evaluation. `bundle exec rspec` (78 examples, 0
failures) and `rubocop` pass locally on Ruby 3.4.7.

**Describe alternatives you've considered**

A `respond_to?(:override_affected)` guard that keeps the 8.19 floor (the
approach in #44). Raising the floor is simpler, stays within the 8.x
major and avoids a dead code path.

**Additional context**

None.

<!-- devin-bot-banner-begin -->
---

<picture><source
srcset="https://app.devin.ai/api/presigned_proxy?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjpudWxsLCJidWNrZXRfbmFtZSI6ImRldmluYXR0YWNobWVudHMiLCJidWNrZXRfa2V5IjoiYXR0YWNobWVudHNfcHJpdmF0ZS9vcmdfaGVBMWRpc2owVHVLd2VVSy8wYTE0ODRlZC00ZjFkLTRiNzItODJmMi03Zjc3YTUzMzI5OWQiLCJpYXQiOjE3OTQ1MjM0NTgsIm9yZ19pZCI6Im9yZ19oZUExZGlzajBUdUt3ZVVLIiwiZmlsZW5hbWUiOiJib3QtYmFubmVyLnBuZyJ9.CWZivj413d8a1B1t-SIa74kOfmygffnKouWWdUwBw-Q"><img
width="112" alt="" align="left"></picture>

<h4><a
href="https://app.devin.ai/bots/649040a7a000452fbe03eca40165f725">OpenFeature
Maintainer</a> opened this PR for Ryan</h4>
<p>Implemented in session <a
href="https://app.devin.ai/sessions/13c6663b53f74a4aa59a17dda110533b">Add
overrideAffected metadata to Ruby provider</a><br>
<a
href="https://app.devin.ai/review/launchdarkly/openfeature-ruby-server/pull/45">Review&nbsp;with&nbsp;Devin</a>
· <a
href="https://app.devin.ai/desktop/session/13c6663b53f74a4aa59a17dda110533b?variant=devin">Open&nbsp;in&nbsp;Devin&nbsp;Desktop</a></p>
<br clear="left">
<!-- devin-bot-banner-end -->
<!-- devin-review-badge-begin -->

---

<a
href="https://app.devin.ai/review/launchdarkly/openfeature-ruby-server/pull/45"
target="_blank"><picture><source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-devin-review-dark.svg?v=4"><img
src="https://static.devin.ai/assets/gh-devin-review-light.svg?v=4"
alt="Devin Review"></picture></a>
<!-- devin-review-badge-end -->

[SDK-3580](https://launchdarkly.atlassian.net/browse/SDK-3580)
<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> Adds **OpenFeature flag metadata** support for LaunchDarkly
**override** evaluations by surfacing `overrideAffected: true` when
`EvaluationReason#override_affected` is set, and omitting the key
otherwise (same pattern as `inExperiment`).
> 
> **`ResolutionDetailsConverter`** gains the `overrideAffected` metadata
key; the **`launchdarkly-server-sdk`** runtime floor moves from **~>
8.19** to **~> 8.20** so `override_affected` is always available. README
feature matrix and flag-metadata table document the new key; specs cover
positive, false, absent, and error-with-override cases.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
461bd56. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

[SDK-3580]:
https://launchdarkly.atlassian.net/browse/SDK-3580?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant